package remote;

import java.util.List;

import models.MBao;

public class Recieve implements IRecieve {

	@Override
	public String sayHello(String name) {
		return "Hello~~, " + name;
	}
	
	public void recieveBaos(List<BaoPOJO> baos){
		for(BaoPOJO bao : baos){
			MBao mBao = fromPOJO2Model(bao);
			mBao.save();
		}
	}
	
	private MBao fromPOJO2Model( BaoPOJO bao){
		MBao mBao = new MBao();
		mBao.title = bao.title;
		mBao.description = bao.description;
		mBao.link = bao.link;
		mBao.picUrl = bao.picUrl;
		mBao.price = bao.price;
		mBao.outDate = bao.outDate;
		mBao.publishDate = bao.publishDate;
		mBao.score = bao.score;
		return mBao;
	}

}
